package com.esmooc.legion.core.common.constant;

/**
 * @author lengleng
 * @date 2019-04-28
 * <p>
 * 缓存的key 常量
 */
public interface CacheConstants {

	/**
	 * 全局缓存，在缓存名称上加上该前缀表示该缓存不区分租户，比如:
	 * <p/>
	 * {@code @Cacheable(value = CacheConstants.GLOBALLY+CacheConstants.MENU_DETAILS, key = "#roleId  + '_menu'", unless = "#result == null")}
	 */
	String GLOBALLY = "gl:";

	/**
	 * 验证码前缀
	 */
	String DEFAULT_CODE_KEY = "DEFAULT_CODE_KEY:";

	/**
	 * 菜单信息缓存
	 */
	String MENU_DETAILS = "menu_details";

	/**
	 * 用户信息缓存
	 */
	String USER_DETAILS = "user_details";

	/**
	 * 角色信息缓存
	 */
	String ROLE_DETAILS = "role_details";

	/**
	 * 字典信息缓存
	 */
	String DICT_DETAILS = "dict_details";

	/**
	 * oauth 客户端信息
	 */
	String CLIENT_DETAILS_KEY = "pigx_oauth:client:details";

	/**
	 * spring boot admin 事件key
	 */
	String EVENT_KEY = GLOBALLY + "event_key";

	/**
	 * 路由存放
	 */
	String ROUTE_KEY = GLOBALLY + "gateway_route_key";

	/**
	 * 内存reload 时间
	 */
	String ROUTE_JVM_RELOAD_TOPIC = "gateway_jvm_route_reload_topic";

	/**
	 * redis 重新加载 路由信息
	 */
	String ROUTE_REDIS_RELOAD_TOPIC = "upms_redis_route_reload_topic";

	/**
	 * redis 重新加载客户端信息
	 */
	String CLIENT_REDIS_RELOAD_TOPIC = "upms_redis_client_reload_topic";

	/**
	 * 公众号 reload
	 */
	String MP_REDIS_RELOAD_TOPIC = "mp_redis_reload_topic";

	/**
	 * 支付 reload 事件
	 */
	String PAY_REDIS_RELOAD_TOPIC = "pay_redis_reload_topic";

	/**
	 * 参数缓存
	 */
	String PARAMS_DETAILS = "params_details";

	/**
	 * 租户缓存 (不区分租户)
	 */
	String TENANT_DETAILS = GLOBALLY + "tenant_details";

	/**
	 * 客户端配置缓存
	 */
	String CLIENT_FLAG = "client_config_flag";

	/**
	 * 登录错误次数
	 */
	String LOGIN_ERROR_TIMES = "login_error_times";




	/**
	 * 邮件验证码key前缀
	 */
	String PRE_EMAIL = "LEGION_PRE_EMAIL:";
	String LOGIN_FAIL_FLAG = "LOGIN_FAIL_FLAG:";


	/**
	 * 钉钉保存state前缀key
	 */
	String DINGDING_STATE = "LEGION_DINGDING:";

	/**
	 * 交互token前缀key
	 */
	String TOKEN_PRE = "LEGION_TOKEN_PRE:";

	/**
	 * 用户token前缀key 单点登录使用
	 */
	String USER_TOKEN = "LEGION_USER_TOKEN:";

	/**
	 * 会员交互token前缀key
	 */
	String TOKEN_MEMBER_PRE = "LEGION_TOKEN_MEMBER_PRE:";

	/**
	 * 会员token前缀key
	 */
	String MEMBER_TOKEN = "LEGION_MEMBER_TOKEN:";

	/**
	 * code前缀
	 */
	String OAUTH_CODE_PRE = "OAUTH_CODE:";

	/**
	 * token前缀
	 */
	String OAUTH_TOKEN_PRE = "OAUTH_TOKEN:";

	/**
	 * token信息前缀
	 */
	String OAUTH_TOKEN_INFO_PRE = "OAUTH_TOKEN_INFO:";

	/**
	 * refresh_token前缀
	 */
	String OAUTH_REFRESH_TOKEN_PRE = "OAUTH_REFRESH_TOKEN:";
	String CLIENT = "CLIENT:";


	/**
	 * github保存state前缀key
	 */
	String GITHUB_STATE = "LEGION_GITHUB:";

	/**
	 * qq保存state前缀key
	 */
	String QQ_STATE = "LEGION_QQ:";

	/**
	 * 微信保存state前缀key
	 */
	String WECHAT_STATE = "LEGION_WECHAT:";

	/**
	 * 微博保存state前缀key
	 */
	String WEIBO_STATE = "LEGION_WEIBO:";

	/**
	 * 企业微信保存state前缀key
	 */
	String WORKWECHAT_STATE = "LEGION_WORKWECHAT:";
	String SEND_SMS = "SEND_SMS:";
	/**
	 * 短信验证码key前缀
	 */
	String PRE_SMS = "LEGION_PRE_SMS:";


	String DEPARTMENT="DEPARTMENT:";
	String USER = "USER:";
	String DEP_IDS = "DEP_IDS:";
	String USER_ROLE = "USER_ROLE:";
	String SEND_EMAIL_CODE = "SEND_EMAIL_CODE:";
	String SEND_ED = "SEND_ED:";
	String LOGIN_TIME_LIMIT = "LOGIN_TIME_LIMIT:";
	String GET_NEW_TOKEN = "GET_NEW_TOKEN:";
	String PERMISSION = "PERMISSION:";
    String USER_MENU_LIST = "USER_MENU_LIST:";
}
